#ifndef INVADER_H
#define INVADER_H

#include "math.h"
#include "stdio.h"
#include <iostream>
#include "Sprite.h"
#include "Bullet.h"

using namespace shapes;

namespace sprites 
{

	class Invader : public Sprite
	{
		ParentNode* leftArm;
		ParentNode* rightArm;
		Bullet* bullet;
		bool bulletShot;
		float angleSign;

	public:
	    //constructors
		Invader(Vector3D _pos, MatterType _type, float _boundRadius);
	    Invader(Vector3D _pos, MatterType _type, float _boundRadius, float scale);
	    ~Invader();

		//animation building
		void build();
		void buildLeftMouth(ParentNode* _parent);
		void buildRightMouth(ParentNode* _parent);
		void buildLeftEar(ParentNode* _parent);
		void buildRightEar(ParentNode* _parent);
		void buildLeftArm(ParentNode* _parent);
		void buildRightArm(ParentNode* _parent);
		
		//collision testing
		virtual BindingSphere getBindingSphere();
		virtual std::vector<BindingSphere> getBindingShapes();
		virtual void handleCollision(MatterType type, BindingSphere sphere);

		//moving
		void moveLeft();
		void moveRight();
		void moveDown();

		//draw animation to screen
		virtual void draw();

		//shooting logic
		Bullet* shoot();
		bool isShooting();
	};
}
#endif